package com.ct.lotterysystem2.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ct.lotterysystem2.dao.dataobject.ActivityDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ActivityMapper extends BaseMapper<ActivityDO> {

    @Select("select count(1) from activity")
    int count();

    @Select("select * from activity by id desc limit #{offset}, #{pageSize}")
    List<ActivityDO> selectActivityList(@Param("offset") Integer offset,
                                        @Param("pageSize") Integer pageSize);
}
